package com.example.simpleFactory.test;

import com.example.simpleFactory.SimpleFactory;
import com.example.simpleFactory.father.FruitsBehavior;

/**
 * 简单工厂模式，一个工厂生产所有相关的产品
 */
public class User {
    public static void main(String[] args) {
        SimpleFactory simpleFactory = new SimpleFactory();
        FruitsBehavior apple = simpleFactory.getFruitsBehavior("Apple");
        apple.eat();

        FruitsBehavior banana = simpleFactory.getFruitsBehavior("Banana");
        banana.eat();
    }
}
